//
//  HomeViewController.swift
//  微博
//
//  Created by Lark on 16/2/22.
//  Copyright © 2016年 Lark. All rights reserved.
//

import UIKit

/// 微博 Cell 可重用标识符号
private let HMStatusCellID = "HMStatusCellID"

class HomeViewController: RootViewController {

    override func viewDidLoad() {
        super.viewDidLoad()

        tableView.dataSource = self
        
        //注册可重用 Cell
        tableView.registerClass(UITableViewCell.self, forCellReuseIdentifier: HMStatusCellID)
    }

    override func didReceiveMemoryWarning() {
        super.didReceiveMemoryWarning()
        // Dispose of any resources that can be recreated.
    }
    
    //override:重写
    override func loadData() {
        //加载数据
        
        
        //关闭刷新
        refreshControl.endRefreshing()
    }
}

// MARK: -UITableViewDataSource
extension HomeViewController:UITableViewDataSource {
    
    func tableView(tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
        return 10
    }
    
    func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell {
        let cell = tableView.dequeueReusableCellWithIdentifier(HMStatusCellID, forIndexPath: indexPath)
        
        cell.textLabel?.text = "\(indexPath.row)"
        
        return cell
    }
}